<template>
  <div class="home-page">
    <img class="bg-img" src="../assets/image/bg.png" />
    <div class="info">
      <img class="logo" src="../assets/image/logo.png" />
      <div class="name">陕西中科非开挖钻机监测系统</div>
    </div>
  </div>
</template>

<script>
// logo从大到小，再显示标题
export default {
  name: 'Home',
  props: {
    msg: String
  },

  mounted () {
    this.getIntoRoute()
  },
  methods: {
    getIntoRoute () {
      setTimeout(() => {
        this.$router.push('/summary')
      }, 2500)
      // this.$router.push({ name: 'Summary' })
    }
  }
}
</script>

<style scoped lang="scss">
.home-page {
  position: relative;
  width: 100vw;
  height: 100vh;

  .bg-img {
    width: 100%;
    height: 100%;
  }

  .info {
    position: absolute;
    top: 4.375rem;
    left: 50%;
    transform: translate(-50%, 0);
    z-index: 100;

    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;

    width: 50%;
    height: auto;
  }
  .logo {
    border-radius: 0.625rem;
    animation: rotateImage 1s linear forwards;
  }

  .name {
    margin-top: 5rem;
    height: 3.125rem;
    line-height: 3.125rem;
    font-weight: bold;
    color: #f1dd0b;
    animation: changeBigger ease-in 1.2s forwards;
    animation-delay: 1s;
  }

  @keyframes rotateImage {
    0% {
      width: 120vw;
    }
    100% {
      margin-top: 6.25rem;
      width: 13.75rem;
    }
  }

  @keyframes changeBigger {
    0% {
      font-size: 0;
      opacity: 0;
    }
    100% {
      font-size: 3rem;
      opacity: 1;
    }
  }
}
</style>
